
local gooi = global.gooi
local Window = require("ui.Window")
local Test = class("Test", Window)

function Test:ctor()
	self.super.ctor(self)
	
    local lbl1 = gooi.newLabel({x = 30, text = "Free elements (no layout):"})
    local lbl2 = gooi.newLabel({text = "0", x = 10, y = 40, w = 90, h = 22})
    lbl2:center()
    local btn1 = gooi.newButton({text = "Exit with tooltip", x = 110, y = 40, w = 180, h = 22})
        -- :setIcon(imgDir.."coin.png"):danger()
        :setTooltip("This is a tooltip!")
        :onRelease(function()
            gooi.confirm({
                text = "Are you sure?",
                ok = function()
	                love.event.quit()
                end
            })
        end)	

	-- local panel = {
	--     name = "panel",
	--     data = {
	--         w = 380,
	--         h = 150
	--     }
	-- }
	-- self.mv:ViewModel(panel)


end

function Test:init()

    -- local button = self.mv:Button({
    --     name = "button",
    --     text = self.mv:bindVar("text"),
    --     x = self.mv:bindVar("x"),
    --     y = self.mv:bindVar("y"),
    --     w = self.mv:bindVar("width"),
    --     h = self.mv:bindVar("height"),
    --     align = "left", 
    --     -- icon = "imgs/exit.png",
    --     onRelease = self.mv:bindMethod("onRelease"),
    -- })



end






return Test